#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include <assert.h>

int mystrlen(const char* arr) 
{
	char* st = arr;
	assert(arr != 'NULL');
	while (*st) 
	{
		st++;
	}
	return st-arr;
}

char* mystrcpy(char* arr2 ,const char* arr1) 
{
	assert(arr2 != 'NULL');
	assert(arr1 != 'NULL');
	char* m = arr2;
	while (*arr2++=*arr1++) 
	{
		;
	}
	return m;
}


int mystrcmp(const char* arr1 ,const char* arr2)
{
	assert(arr1 != 'NULL');
	assert(arr2 != 'NULL');
	while (*arr1 == *arr2) 
	{
		if (*arr1 == '\0')
			return 0;
		arr1++;
		arr2++;
	}
	return *arr1 - *arr2;
}

void mystrcat(char* arr1,const char* arr2) 
{
	assert(arr1 != 'NULL');
	assert(arr2 != 'NULL');
	while(*arr1)
	{
		arr1++;
	}
	while (*arr2) 
	{
		*arr1++ = *arr2++;
	}
	*arr1 = '\0';
}

int main() 
{
	char arr1[200] = "abcdefg";
	char arr2[] = "abcdefh";
	//int ret = mystrlen(arr1);
	//printf("%d ", ret);

	//char* ret2 = mystrcpy(arr2, arr1);
	//printf("%s", ret2);

	//int ret3 = mystrcmp(arr1,arr2);
	//printf("%d", ret3);

	mystrcat(arr1,arr2);
	printf("%s",arr1);
	return 0;
}